package at.jaki.ubb.crawling.model;

public class Target<E> implements Comparable<Target<E>> {

	private Double priority = 0d;
	private String id;
	private E value;
	private String type;

	public Target(Double priority, String id, String type, E value) {
		super();
		this.priority = priority;
		this.id = id;
		this.value = value;
		this.type = type;
	}

	public final Double getPriority() {
		return priority;
	}

	public final String getId() {
		return id;
	}

	public final E getValue() {
		return value;
	}

	public final String getType() {
		return type;
	}

	@Override
	public int compareTo(Target<E> o) {
		return this.getPriority().compareTo(o.getPriority());
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append('[');
		sb.append(getId());
		sb.append(']');
		sb.append('(');
		sb.append(getPriority());
		sb.append(") -");
		sb.append(getType());
		sb.append("- ");
		sb.append(getValue());
		return sb.toString();
	}
}
